<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
	</body>
	<script>
		/ 建造者，汽车部件厂家
		class CarBuilder {
			constructor(param) {
				this.param = param
			}

			/* 生产部件，part1 */
			buildPart1() {
				this.part1 = 'part1'
				return this
			}

			/* 生产部件，part2 */
			buildPart2() {
				this.part2 = 'part2'
				return this
			}
		}

		// 汽车装配，获得产品实例
		const benchi1 = new CarBuilder('param')
			.buildPart1()
			.buildPart2()
	</script>

</html>